{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "*1. 2022/9/26/week 06\n",
    " 2. Python学习计划"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 本周知识点\n",
    ">1. 随机函数\n",
    ">2. 时间函数"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1. 随机函数\n",
    ">1. random.random():生成随机数0-1之间随机数\n",
    ">2. random.randint():生成随机数\n",
    ">3. random.choices():随机抽样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function random:\n",
      "\n",
      "random(...) method of random.Random instance\n",
      "    random() -> x in the interval [0, 1).\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(random.random)  #0-1 floot 小数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.9018238918496919"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "random.random()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method randint in module random:\n",
      "\n",
      "randint(a, b) method of random.Random instance\n",
      "    Return random integer in range [a, b], including both end points.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(random.randint)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "random.randint(0,6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n",
      "3\n",
      "6\n",
      "2\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "# randint 小实践：大话骰\n",
    "for i in range(5):\n",
    "    print(random.randint(1,6))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# randint 小实践：猜数字，0-100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Alex'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "random.choice(['Alex','xiaohong','lihua'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 时间函数time()\n",
    ">1. 时间延迟函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=10, tm_mday=11, tm_hour=22, tm_min=23, tm_sec=38, tm_wday=1, tm_yday=284, tm_isdst=0)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function sleep in module time:\n",
      "\n",
      "sleep(...)\n",
      "    sleep(seconds)\n",
      "    \n",
      "    Delay execution for a given number of seconds.  The argument may be\n",
      "    a floating point number for subsecond precision.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(time.sleep)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "time.sleep(2)\n",
    "print('hello world')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99 bottles 在啤酒墙上~~\n",
      "99 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "98 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "98 bottles 在啤酒墙上~~\n",
      "98 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "97 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "97 bottles 在啤酒墙上~~\n",
      "97 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "96 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "96 bottles 在啤酒墙上~~\n",
      "96 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "95 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "95 bottles 在啤酒墙上~~\n",
      "95 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "94 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "94 bottles 在啤酒墙上~~\n",
      "94 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "93 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "93 bottles 在啤酒墙上~~\n",
      "93 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "92 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "92 bottles 在啤酒墙上~~\n",
      "92 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "91 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "91 bottles 在啤酒墙上~~\n",
      "91 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "90 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "90 bottles 在啤酒墙上~~\n",
      "90 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "89 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "89 bottles 在啤酒墙上~~\n",
      "89 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "88 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "88 bottles 在啤酒墙上~~\n",
      "88 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "87 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "87 bottles 在啤酒墙上~~\n",
      "87 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "86 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "86 bottles 在啤酒墙上~~\n",
      "86 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "85 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "85 bottles 在啤酒墙上~~\n",
      "85 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "84 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "84 bottles 在啤酒墙上~~\n",
      "84 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "83 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "83 bottles 在啤酒墙上~~\n",
      "83 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "82 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "82 bottles 在啤酒墙上~~\n",
      "82 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "81 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "81 bottles 在啤酒墙上~~\n",
      "81 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "80 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "80 bottles 在啤酒墙上~~\n",
      "80 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "79 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "79 bottles 在啤酒墙上~~\n",
      "79 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "78 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "78 bottles 在啤酒墙上~~\n",
      "78 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "77 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "77 bottles 在啤酒墙上~~\n",
      "77 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "76 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "76 bottles 在啤酒墙上~~\n",
      "76 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "75 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "75 bottles 在啤酒墙上~~\n",
      "75 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "74 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "74 bottles 在啤酒墙上~~\n",
      "74 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "73 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "73 bottles 在啤酒墙上~~\n",
      "73 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "72 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "72 bottles 在啤酒墙上~~\n",
      "72 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "71 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "71 bottles 在啤酒墙上~~\n",
      "71 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "70 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "70 bottles 在啤酒墙上~~\n",
      "70 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "69 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "69 bottles 在啤酒墙上~~\n",
      "69 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "68 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "68 bottles 在啤酒墙上~~\n",
      "68 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "67 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "67 bottles 在啤酒墙上~~\n",
      "67 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "66 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "66 bottles 在啤酒墙上~~\n",
      "66 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "65 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "65 bottles 在啤酒墙上~~\n",
      "65 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "64 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "64 bottles 在啤酒墙上~~\n",
      "64 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "63 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "63 bottles 在啤酒墙上~~\n",
      "63 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "62 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "62 bottles 在啤酒墙上~~\n",
      "62 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "61 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "61 bottles 在啤酒墙上~~\n",
      "61 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "60 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "60 bottles 在啤酒墙上~~\n",
      "60 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "59 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "59 bottles 在啤酒墙上~~\n",
      "59 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "58 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "58 bottles 在啤酒墙上~~\n",
      "58 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "57 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "57 bottles 在啤酒墙上~~\n",
      "57 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "56 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "56 bottles 在啤酒墙上~~\n",
      "56 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "55 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "55 bottles 在啤酒墙上~~\n",
      "55 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "54 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "54 bottles 在啤酒墙上~~\n",
      "54 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "53 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "53 bottles 在啤酒墙上~~\n",
      "53 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "52 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "52 bottles 在啤酒墙上~~\n",
      "52 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "51 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "51 bottles 在啤酒墙上~~\n",
      "51 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "50 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "50 bottles 在啤酒墙上~~\n",
      "50 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "49 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "49 bottles 在啤酒墙上~~\n",
      "49 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "48 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "48 bottles 在啤酒墙上~~\n",
      "48 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "47 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "47 bottles 在啤酒墙上~~\n",
      "47 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "46 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "46 bottles 在啤酒墙上~~\n",
      "46 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "45 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "45 bottles 在啤酒墙上~~\n",
      "45 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "44 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "44 bottles 在啤酒墙上~~\n",
      "44 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "43 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "43 bottles 在啤酒墙上~~\n",
      "43 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "42 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "42 bottles 在啤酒墙上~~\n",
      "42 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "41 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "41 bottles 在啤酒墙上~~\n",
      "41 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "40 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "40 bottles 在啤酒墙上~~\n",
      "40 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "39 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "39 bottles 在啤酒墙上~~\n",
      "39 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "38 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "38 bottles 在啤酒墙上~~\n",
      "38 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "37 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "37 bottles 在啤酒墙上~~\n",
      "37 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "36 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "36 bottles 在啤酒墙上~~\n",
      "36 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "35 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "35 bottles 在啤酒墙上~~\n",
      "35 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "34 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "34 bottles 在啤酒墙上~~\n",
      "34 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "33 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "33 bottles 在啤酒墙上~~\n",
      "33 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "32 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "32 bottles 在啤酒墙上~~\n",
      "32 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "31 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "31 bottles 在啤酒墙上~~\n",
      "31 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "30 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "30 bottles 在啤酒墙上~~\n",
      "30 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "29 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "29 bottles 在啤酒墙上~~\n",
      "29 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "28 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "28 bottles 在啤酒墙上~~\n",
      "28 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "27 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "27 bottles 在啤酒墙上~~\n",
      "27 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "26 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "26 bottles 在啤酒墙上~~\n",
      "26 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "25 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "25 bottles 在啤酒墙上~~\n",
      "25 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "24 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "24 bottles 在啤酒墙上~~\n",
      "24 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "23 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "23 bottles 在啤酒墙上~~\n",
      "23 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "22 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "22 bottles 在啤酒墙上~~\n",
      "22 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "21 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "21 bottles 在啤酒墙上~~\n",
      "21 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "20 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "20 bottles 在啤酒墙上~~\n",
      "20 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "19 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "19 bottles 在啤酒墙上~~\n",
      "19 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "18 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "18 bottles 在啤酒墙上~~\n",
      "18 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "17 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "17 bottles 在啤酒墙上~~\n",
      "17 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "16 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "16 bottles 在啤酒墙上~~\n",
      "16 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "15 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "15 bottles 在啤酒墙上~~\n",
      "15 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "14 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "14 bottles 在啤酒墙上~~\n",
      "14 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "13 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "13 bottles 在啤酒墙上~~\n",
      "13 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "12 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "12 bottles 在啤酒墙上~~\n",
      "12 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "11 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "11 bottles 在啤酒墙上~~\n",
      "11 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "10 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "10 bottles 在啤酒墙上~~\n",
      "10 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "9 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "9 bottles 在啤酒墙上~~\n",
      "9 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "8 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "8 bottles 在啤酒墙上~~\n",
      "8 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "7 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "7 bottles 在啤酒墙上~~\n",
      "7 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "6 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "6 bottles 在啤酒墙上~~\n",
      "6 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "5 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "5 bottles 在啤酒墙上~~\n",
      "5 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "4 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "4 bottles 在啤酒墙上~~\n",
      "4 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "3 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "3 bottles 在啤酒墙上~~\n",
      "3 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "2 bottles 在啤酒墙上~~\n",
      "---------------\n",
      "2 bottles 在啤酒墙上~~\n",
      "2 bottles 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "1 bottle 在啤酒墙上~~\n",
      "---------------\n",
      "1 bottle 在啤酒墙上~~\n",
      "1 bottle 啤酒~~\n",
      "拿下来一瓶给我吧~~\n",
      "啤酒被拿走一瓶了~~\n",
      "只剩一瓶了，不能给你了，要放在墙上展示\n",
      "---------------\n"
     ]
    }
   ],
   "source": [
    "beer_name = \"bottles\"\n",
    "for beer_num in range(99,0,-1):\n",
    "    print(beer_num,beer_name,\"在啤酒墙上~~\")\n",
    "    print(beer_num,beer_name,\"啤酒~~\")\n",
    "    print(\"拿下来一瓶给我吧~~\")\n",
    "    print(\"啤酒被拿走一瓶了~~\")\n",
    "    # 情况一：只剩一瓶的情况：\n",
    "    if beer_num == 1:\n",
    "        print(\"只剩一瓶了，不能给你了，要放在墙上展示\")\n",
    "    # 情况二：还有多于1瓶的情况\n",
    "    else:\n",
    "        new_num = beer_num - 1\n",
    "        if new_num ==1 :\n",
    "            beer_name = \"bottle\"\n",
    "        print(new_num,beer_name,\"在啤酒墙上~~\")\n",
    "    print(\"---------------\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 有序的数据结构\n",
    ">1. 数值\n",
    ">>1. 数值的运算\n",
    ">2. 字符串\n",
    ">3. 列表 元组 字典 集合 （期中考核）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 3. 数值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "* 3.1 数值的基本运算（operation)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
